<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>aiengine: xaietile_error.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">aiengine
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaietile__error_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">xaietile_error.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains routines for error handling. </p>
<p>There are three types of error events:</p>
<ul>
<li>Errors without notification, by default when this error happens, no notification is raised, user can register for events hadler for this type of errors.</li>
<li>Errors for logging only, by default, when this error happens driver will be notified by the interrupt, the driver will log this error and clear it.</li>
<li>Errors will notify users, by default, when this error happens, driver will call the registered error handler, based on the return value from the error handler, driver will kill the application or not. If there is no registered application error handler, driver will kill the application.</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who     Date     Changes
</p>
<hr/>
<p>
1.0   Wendy   01/02/2020  Initial creation
1.1   Dishita 03/29/2020  Add support for clock gating
</pre> </div><table class="memberdecls">
<tr class="memitem:a6edd2cb413cec480f285bfe3012a9df0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaietile__error_8c.html#a6edd2cb413cec480f285bfe3012a9df0">XAIETILE_ERROR_BROADCAST</a>&#160;&#160;&#160;0U</td></tr>
<tr class="memdesc:a6edd2cb413cec480f285bfe3012a9df0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Broadcast signal to broadcast errors.  <a href="#a6edd2cb413cec480f285bfe3012a9df0">More...</a><br/></td></tr>
<tr class="separator:a6edd2cb413cec480f285bfe3012a9df0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa7caab1929ed87aad48c8c965c10cb66"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaietile__error_8c.html#aa7caab1929ed87aad48c8c965c10cb66">XAIETILE_ERROR_SHIM_INTEVENT</a>&#160;&#160;&#160;0x10U</td></tr>
<tr class="memdesc:aa7caab1929ed87aad48c8c965c10cb66"><td class="mdescLeft">&#160;</td><td class="mdescRight">SHIM Internal event for errors.  <a href="#aa7caab1929ed87aad48c8c965c10cb66">More...</a><br/></td></tr>
<tr class="separator:aa7caab1929ed87aad48c8c965c10cb66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aefea36715a914342712138f70703d99a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaietile__error_8c.html#aefea36715a914342712138f70703d99a">XAIETILE_1ST_IRQ_IDS_MASK</a>&#160;&#160;&#160;0x3FU</td></tr>
<tr class="memdesc:aefea36715a914342712138f70703d99a"><td class="mdescLeft">&#160;</td><td class="mdescRight">1st level interrupt output IRQ ids mask Event 1st level interrupt controller has its own irq IDs to the 2nd level interrupt controller.  <a href="#aefea36715a914342712138f70703d99a">More...</a><br/></td></tr>
<tr class="separator:aefea36715a914342712138f70703d99a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa10e64442cc7d456e141abd8af5549a0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaietile__error_8c.html#aa10e64442cc7d456e141abd8af5549a0">XAieTile_ErrorRegisterNotification</a> (<a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *AieInst, u8 Module, u8 Error, <a class="el" href="xaiegbl_8h.html#ac921ebe961992e2d7c474703de794d7d">XAieTile_ErrorCallBack</a> Cb, void *Arg)</td></tr>
<tr class="memdesc:aa10e64442cc7d456e141abd8af5549a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This API sets user callback to the specified error.  <a href="#aa10e64442cc7d456e141abd8af5549a0">More...</a><br/></td></tr>
<tr class="separator:aa10e64442cc7d456e141abd8af5549a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a184ab837ae72698aa68e2ada951641a0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaietile__error_8c.html#a184ab837ae72698aa68e2ada951641a0">XAieTile_ErrorUnregisterNotification</a> (<a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *AieInst, u8 Module, u8 Error, u8 Logging)</td></tr>
<tr class="memdesc:a184ab837ae72698aa68e2ada951641a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This API sets user callback to the specified error.  <a href="#a184ab837ae72698aa68e2ada951641a0">More...</a><br/></td></tr>
<tr class="separator:a184ab837ae72698aa68e2ada951641a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a755d6015bdfaa9aee2880862d5f25444"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaietile__error_8c.html#a755d6015bdfaa9aee2880862d5f25444">XAieTile_ErrorsSetupDefaultHandler</a> (<a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *AieInst)</td></tr>
<tr class="memdesc:a755d6015bdfaa9aee2880862d5f25444"><td class="mdescLeft">&#160;</td><td class="mdescRight">This API initialize error default handlers.  <a href="#a755d6015bdfaa9aee2880862d5f25444">More...</a><br/></td></tr>
<tr class="separator:a755d6015bdfaa9aee2880862d5f25444"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05b29e29d8b2812b761046e617be8dfa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaietile__error_8c.html#a05b29e29d8b2812b761046e617be8dfa">XAieTile_ErrorsHandlingInitialize</a> (<a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *AieInst)</td></tr>
<tr class="memdesc:a05b29e29d8b2812b761046e617be8dfa"><td class="mdescLeft">&#160;</td><td class="mdescRight">This API initialize error handling.  <a href="#a05b29e29d8b2812b761046e617be8dfa">More...</a><br/></td></tr>
<tr class="separator:a05b29e29d8b2812b761046e617be8dfa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="aefea36715a914342712138f70703d99a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XAIETILE_1ST_IRQ_IDS_MASK&#160;&#160;&#160;0x3FU</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>1st level interrupt output IRQ ids mask Event 1st level interrupt controller has its own irq IDs to the 2nd level interrupt controller. </p>
<p>For column 0 to 43, the pattern is: 0 1 2 3 4 5 0 1, 0 1 2 3 4 5 0 1 for column 44 to 49, the pattern is: 0 1 2 3 4 5 0 1 2 3 4 5 </p>

</div>
</div>
<a class="anchor" id="a6edd2cb413cec480f285bfe3012a9df0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XAIETILE_ERROR_BROADCAST&#160;&#160;&#160;0U</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Broadcast signal to broadcast errors. </p>

</div>
</div>
<a class="anchor" id="aa7caab1929ed87aad48c8c965c10cb66"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XAIETILE_ERROR_SHIM_INTEVENT&#160;&#160;&#160;0x10U</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>SHIM Internal event for errors. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="aa10e64442cc7d456e141abd8af5549a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XAieTile_ErrorRegisterNotification </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *&#160;</td>
          <td class="paramname"><em>AieInst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Module</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Error</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="xaiegbl_8h.html#ac921ebe961992e2d7c474703de794d7d">XAieTile_ErrorCallBack</a>&#160;</td>
          <td class="paramname"><em>Cb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>Arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This API sets user callback to the specified error. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AieInst</td><td>- Pointer to the AIE device instance </td></tr>
    <tr><td class="paramname">Module</td><td>- Module type XAIEGBL_MODULE_CORE, XAIEGBL_MODULE_PL, XAIEGBL_MODULE_MEM, XAIEGBL_MODULE_ALL or any OR value of CORE, PL and MEM. </td></tr>
    <tr><td class="paramname">Error</td><td>- Error event id 0 for any errors which will generate interrupt. 48 - 69 for Core module 87 - 100 for Memory module 62 - 72 for SHIM PL module </td></tr>
    <tr><td class="paramname">Cb</td><td>- User error callback function pointer If callback is NULL, when this error happens, it will kill the application. </td></tr>
    <tr><td class="paramname">Arg</td><td>- Argument which will be passed to callback function, it can be NULL.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XAIE_SUCCESS if successful, else XAIE_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xaielib_8c.html#a10fd65d3e1f99d55f83d6a9ef950e9ec">XAieLib_IntPrint()</a>, and <a class="el" href="xaietile__error_8h.html#a6fc0ed8eca0713c4f873d20036a3856b">XAIETILE_ERROR_ALL</a>.</p>

</div>
</div>
<a class="anchor" id="a05b29e29d8b2812b761046e617be8dfa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XAieTile_ErrorsHandlingInitialize </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *&#160;</td>
          <td class="paramname"><em>AieInst</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This API initialize error handling. </p>
<p>It will setup the error broadcast network so that if error is raised, interrupt will be raised, and the interrupt will be captured by the AIE driver. When errors happens, the AIE driver will either take default action which will trap the application or call the user registered callback.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AieInst</td><td>- Pointer to the AIE device instance</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XAIE_SUCCESS if successful, else XAIE_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a class="anchor" id="a755d6015bdfaa9aee2880862d5f25444"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAieTile_ErrorsSetupDefaultHandler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *&#160;</td>
          <td class="paramname"><em>AieInst</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This API initialize error default handlers. </p>
<p>When errors happens, the AIE driver will either take default action which will trap the application or call the user registered callback.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AieInst</td><td>- Pointer to the AIE device instance</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a class="anchor" id="a184ab837ae72698aa68e2ada951641a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XAieTile_ErrorUnregisterNotification </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_aie_gbl.html">XAieGbl</a> *&#160;</td>
          <td class="paramname"><em>AieInst</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Module</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Error</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Logging</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This API sets user callback to the specified error. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AieInst</td><td>- Pointer to the AIE device instance </td></tr>
    <tr><td class="paramname">Module</td><td>- Module type XAIEGBL_MODULE_CORE, XAIEGBL_MODULE_PL, XAIEGBL_MODULE_MEM </td></tr>
    <tr><td class="paramname">Error</td><td>- Error event id 48 - 69 for Core module 87 - 100 for Memory module 62 - 72 for SHIM PL module </td></tr>
    <tr><td class="paramname">Logging</td><td>- Indicate if it needs to log. If it doesn't need to log, when the error happens, there will be no interrupt raised. XAIE_ENABLE - need to log, XAIE_DISABLE - no need to log</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
